package com.lagou.service.impl;

import com.lagou.api.IEmailService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

/**
 * Created by wangq on 2021/9/26.
 */
@Service
public class EmailServiceImpl implements IEmailService {
    private static final Logger logger = LoggerFactory.getLogger(EmailServiceImpl.class);

    @Value("${spring.mail.username}")
    private String fromEmail;


    @Override
    public Boolean send(String email, String code) {
//        SimpleMailMessage message = new SimpleMailMessage();
//        message.setFrom(fromEmail);
//        message.setTo(email);
//        message.setSubject("验证码");
//        message.setText(code);
//        JavaMailSender javaMailSender = new JavaMailSenderImpl();
//        javaMailSender.send(message);
        logger.info("验证码发送成功,邮箱:{},验证码:{}", email, code);
        return true;
    }
}
